/*
 * @Description: 项目经理月报评价数据模型
 * @Author: wind-lc
 * @version: 1.0
 * @Date: 2022-04-07 16:10:25
 * @LastEditTime: 2022-04-19 10:40:30
 * @FilePath: \cscec-pms-admin\src\views\project\projectManagerMonthlyReportEvaluate\model.js
 */
// 重点
const important = [
  {
    value: '0',
    label: '否'
  },
  {
    value: '1',
    label: '是'
  }
]
// 状态
const status = [
  {
    value: 0,
    label: '审核中'
  },
  {
    value: 1,
    label: '审核通过'
  },
  {
    value: 2,
    label: '审核不通过'
  }
]
// 项目经理月报评价搜索项
const searchOption = [
  {
    name: '项目经理名称',
    value: 'pmName',
    type: 'input',
  },
  {
    name: '月度',
    value: 'reportMonthly',
    type: 'monthRange',
    attr: {
      rangeFormat: ['reportMonthlyStartTime', 'reportMonthlyEndTime']
    }
  },
  {
    name: '分公司评分',
    value: 'branchCom',
    type: 'select',
    data: [
      {
        value: '90-100',
        label: '90-100',
      },
      {
        value: '80-89',
        label: '80-89',
      },
      {
        value: '70-79',
        label: '70-79',
      },
      {
        value: '60-69',
        label: '60-69',
      },
      {
        value: '0-59',
        label: '60以下',
      }
    ]
  },
  {
    name: '公司评分',
    value: 'company',
    type: 'select',
    data: [
      {
        value: '90-100',
        label: '90-100',
      },
      {
        value: '80-89',
        label: '80-89',
      },
      {
        value: '70-79',
        label: '70-79',
      },
      {
        value: '60-69',
        label: '60-69',
      },
      {
        value: '0-59',
        label: '60以下',
      }
    ]
  }
]
// 项目经理月报评价表头
const columns = [
  {
    title: '序号',
    width: 80,
    align: 'center',
    customRender: (text, record, index) => {
      return index + 1
    }
  },
  {
    title: '项目经理名称',
    width: 200,
    ellipsis: true,
    dataIndex: 'pmName'
  },
  {
    title: '所属项目',
    width: 200,
    ellipsis: true,
    dataIndex: 'projectName'
  },
  {
    title: '是否重点项目',
    width: 80,
    align: 'center',
    dataIndex: 'isImportant',
    customRender: (text) => {
      return important.find(el => el.value === text)?.label
    }
  },
  {
    title: '所属分公司',
    ellipsis: true,
    width: 120,
    dataIndex: 'branchComName'
  },
  {
    title: '报告期数',
    ellipsis: true,
    width: 120,
    align: 'center',
    dataIndex: 'reportPeriods'
  },
  {
    title: '报告月度',
    ellipsis: true,
    width: 120,
    align: 'center',
    dataIndex: 'reportMonthly'
  },
  {
    title: '分公司评价分数',
    ellipsis: true,
    width: 140,
    align: 'center',
    dataIndex: 'branchComScore',
    customRender: (text) => {
      return text === null ? '-' : text
    }
  },
  {
    title: '公司评价分数',
    ellipsis: true,
    width: 120,
    align: 'center',
    dataIndex: 'companyScore',
    customRender: (text) => {
      return text === null ? '-' : text
    }
  },
  {
    title: '评价状态',
    ellipsis: true,
    width: 120,
    align: 'center',
    dataIndex: 'evaluationStatus',
    customRender: (text) => {
      return status.find(el => el.value === text)?.label
    }
  },
  {
    title: '操作',
    dataIndex: 'operation',
    width: 180,
    align: 'center',
    scopedSlots: { customRender: 'operation' }
  }
]
// 基本信息表单项
const formOption = [
  {
    label: '项目经理名称',
    keyName: 'pmName',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '所属项目',
    keyName: 'projectName',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '项目编号',
    keyName: 'projectCode',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '所属分公司',
    keyName: 'branchComName',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '是否重点项目',
    keyName: 'isImportant',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '建设单位',
    keyName: 'constructionUnit',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '报告期数',
    keyName: 'reportPeriods',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '报告月度',
    keyName: 'reportMonthly',
    type: 'BaseInput',
    disabled: true
  }
]
// 项目经理月报评价详情表头
const columns1 = [
  {
    title: '序号',
    width: 80,
    align: 'center',
    customRender: (text, record, index) => {
      return index + 1
    }
  },
  {
    title: '工作名称',
    ellipsis: true,
    dataIndex: 'workName'
  },
  {
    title: '评价部门',
    width: 300,
    ellipsis: true,
    dataIndex: 'valuationDepartmentName'
  },
  {
    title: '意见',
    ellipsis: true,
    dataIndex: 'opinion'
  },
  {
    title: '得分',
    width: 120,
    align: 'center',
    ellipsis: true,
    dataIndex: 'evaluationScore'
  },
  {
    title: '权重',
    width: 100,
    align: 'center',
    ellipsis: true,
    dataIndex: 'weight',
    customRender: (text) => {
      return Number(text) * 100 + '%'
    }
  },
  {
    title: '实际得分',
    width: 120,
    align: 'center',
    ellipsis: true,
    dataIndex: 'realityScore'
  }
]
// 审批评价表头
const columns2 = [
  {
    title: '序号',
    width: 80,
    align: 'center',
    customRender: (text, record, index) => {
      return index + 1
    }
  },
  {
    title: '工作名称',
    ellipsis: true,
    dataIndex: 'workName'
  },
  {
    title: '评价部门',
    width: 300,
    ellipsis: true,
    dataIndex: 'valuationDepartmentName'
  },
  {
    title: '意见',
    ellipsis: true,
    dataIndex: 'opinion',
    scopedSlots: { customRender: 'opinion' }
  },
  {
    title: '得分',
    width: 160,
    align: 'center',
    ellipsis: true,
    dataIndex: 'evaluationScore',
    scopedSlots: { customRender: 'evaluationScore' }
  }
]
// 流程节点关键字
const taskDefKey = [
  // 分公司各部门
  {
    key: 'FGS_SWFWB_BMJL_AUDIT',
    type: 'controlledCompanyDepartment'
  },
  {
    key: 'FGS_RLZYB_BMJL_AUDIT',
    type: 'controlledCompanyDepartment'
  },
  {
    key: 'FGS_CWZJB_BMJL_AUDIT',
    type: 'controlledCompanyDepartment'
  },
  {
    key: 'FGS_SGGLB_BMJL_AUDIT',
    type: 'controlledCompanyDepartment'
  },
  {
    key: 'FGS_CGZX_BMJL_AUDIT',
    type: 'controlledCompanyDepartment'
  },
  {
    key: 'FGS_AQSCJDFLB_BMJL_AUDIT',
    type: 'controlledCompanyDepartment'
  },
  {
    key: 'FGS_BIMGZZ_BMJL_AUDIT',
    type: 'controlledCompanyDepartment'
  },
  // 分公司各总工
  {
    key: 'FGS_ZGCS_AUDIT',
    type: 'controlledCompanyEngineer'
  },
  {
    key: 'FGS_SCFJL_AUDIT',
    type: 'controlledCompanyEngineer'
  },
  {
    key: 'FGS_ZKJS_AUDIT',
    type: 'controlledCompanyEngineer'
  },
  {
    key: 'FGS_ZJJS_AUDIT',
    type: 'controlledCompanyEngineer'
  },
  // 公司各部门
  {
    key: 'GS_SWFWB_BMJL_AUDIT',
    type: 'companyDepartment'
  },
  {
    key: 'GS_RLZYB_BMJL_AUDIT',
    type: 'companyDepartment'
  },
  {
    key: 'GS_CWZJB_BMJL_AUDIT',
    type: 'companyDepartment'
  },
  {
    key: 'GS_CGZX_BMJL_AUDIT',
    type: 'companyDepartment'
  },
  {
    key: 'GS_AQSCJDFLB_BMJL_AUDIT',
    type: 'companyDepartment'
  },
  {
    key: 'GS_SGGLB_BMJL_AUDIT',
    type: 'companyDepartment'
  },
  {
    key: 'GS_BIMGZZ_BMJL_AUDIT',
    type: 'companyDepartment'
  },
  {
    key: 'GS_GCGLB_BMJL_AUDIT',
    type: 'companyDepartment'
  },
  // 公司各总工
  {
    key: 'GS_ZGCS_AUDIT',
    type: 'companyEngineer'
  },
  {
    key: 'GS_SCFJL_AUDIT',
    type: 'companyEngineer'
  },
  {
    key: 'GS_ZJJS_AUDIT',
    type: 'companyEngineer'
  },
  {
    key: 'GS_ZKJS_AUDIT',
    type: 'companyEngineer'
  }
]
// 审批得分
const score = [
  {
    value: '100',
    label: '100'
  },
  {
    value: '90',
    label: '90'
  },
  {
    value: '80',
    label: '80'
  },
  {
    value: '70',
    label: '70'
  },
  {
    value: '60',
    label: '60'
  },
  {
    value: '50',
    label: '60以下'
  }
]
export {
  searchOption,
  columns,
  formOption,
  columns1,
  important,
  columns2,
  taskDefKey,
  score
}
